Do these scenarios sound familiar? You just copied a bunch of stuff from a CD-ROM to a hard drive, and all your aliases are messed up. Or, you just restored from a backup, and all your aliases are all messed up. Or, you just copied a bunch of stuff from one hard drive to another, and...
Apple's Alias Manager isn't designed to handle situations like the above, where you copy files and aliases to those files, and expect the newly copied aliases to 'point' to the newly copied files. Sure you can manually fix the aliases--but if you have any more than about 5, it becomes a pain to wander through the folders, clicking on aliases, Get Info, Find original, etc. And, it doesn't always work, forcing you to create new ones. Enter Alias Repointer.
What Is It & How Does It Work:
Alias Repointer is an application that is designed to 'fix' aliases to files that have been copied from one (possibly ejectable) volume to another. Since the Volume name, creation date, and other pertinent information about a given file's home volume changes, it confuses the Alias Manager (much like I'm confusing you [and me]).
Anyway, Alias Repointer takes as its input a folder (either via dragging & dropping the folder onto the application, or selecting a folder in the standard file dialog that is presented when the application is launched). It looks through this folder, and all sub-folders within it, scavenging for aliases. When it encounters one, it makes sure it can be resolved OK. If so, it moves happily (and speedily) along. If not, it does an exhaustive search for a file that matches the name, creator, and type of the file that it originally pointed to. It first searches within the specified directory--if it doesn't find it there, it broadens the search to the entire volume on which the alias resides.
DURING THE SEARCH, THE FIRST FILE IT ENCOUNTERS THAT MATCHES THE NAME, CREATOR, & TYPE IS THE FILE THAT IT 'REPOINTS'. And since it's searching something called the 'catalog tree', it has no correlation to the folder hierarchy on the volume (so if their are multiple copies of the file in question, it is completely arbitrary about choosing which to 'repoint' to).
The bottom line is, it automatically fixes all aliases within the specified folder (and it's sub-folders) that are broken--at the rate of about one per second (on my 1 GIG drive--your mileage may vary). It doesn't touch those aliases that are resolvable already (normal, working aliases).
Since I developed this program at home, I didn't think about aliases to items previously mounted AppleShare (or other remote) volumes. Consequently, version 1.0 doesn't handle these aliases very well. Version 1.1 does better, but Alias Repointer still treats these aliases as though they may point to an item locally (and searches for them as such). This behavior could cause problems for certain users, so I've added a 'Network mode' to Alias Repointer. In this mode, it automatically ignores (leaves untouched) any alias that looks like it pointed to a file on a remote volume. To put Alias Repointer into this mode, simply hold down the option key as you double-click on the application, or as you drag and drop a folder onto the application's icon.
If the above explanation confuses you, use this simple rule to be safe. If your Mac is connected to a network, use the option key (better safe than sorry). If the above explanation leaves you starving for more specific technical information on the subject, see the section below called "Network Aliases".
To use Alias Repointer:
• Simply drag and drop one or more folders or volumes onto the icon for Alias Repointer--it automatically does the rest.
... or ...
• Double-click on Alias Repointer. You will be presented with a standard file dialog asking you to select the folder in which you want to search for and 'repoint' aliases. Navigate to and click on the folder you wish, then click the 'Select "myfolder"' button at the bottom of the dialog. It automatically does the rest.
When Alias Repointer encounters an alias that needs 'repointing', it displays the name of that file in the progress window. If you run it using the same folder twice in a row, the second time will go much faster (because Alias Repointer fixed all the bad aliases the first time).
Also, be aware that the Finder caches the information presented in the 'Get Info' dialog box--if you 'Get Info' on an alias, then run Alias Repointer, then 'Get Info' again, the information it shows may be 'stale'--close the parent folder and reopen it to 'refresh' this information.
Alias Repointer is a FAT binary (meaning it will work on 68K machines, and on PowerMacs in 'native' mode). I don't know whether it is significantly faster on PowerMacs or not...
Alias Repointer REQUIRES System 7!!!
Network Aliases:
There is a fundamental difference between regular aliases, and what I'm calling 'Network Aliases'. Network Aliases contain additional information like what zone and what server the target resides on. A Network Alias is created by making an alias to an item that resides on a remotely mounted AppleShare (or other) volume. Or, if the machine your using has AppleShare running on it, any aliases you make will be Network Aliases. It's important to note that this also applies to System 7 file sharing--when you 'Start' sharing (in the 'Sharing Setup' control panel), any aliases you make (whether the target is on a shared volume or not) will be Network Aliases. If you don't know about System 7 file sharing, you probably shouldn't mess with it--aside from potential 'network exposure' (kinda like unknowingly opening your silicon trench coat), it also slows your Mac down.
To the best of my knowledge, there is no (programmatic) way to tell the difference between Network Aliases that were created locally (like those created with System 7 file sharing turned on), and Network Aliases that were created remotely (from an item on a remotely mounted volume). This situation opens a Pandora's box of potential problems. If you're like me, you sometimes run file sharing, sometimes not. So, I could have (and do have) Network Aliases strewn across my hard drives that may or may not point to items that are actually on remote volumes. Now that you know a little bit about the problem,
IF YOU HAVE ALIASES THAT POINT TO ITEMS ON A REMOTE VOLUME, MOUNTED OR UNMOUNTED, AND YOU WANT TO KEEP THESE ALIASES INTACT, TAKE ANY OF THE FOLLOWING STEPS TO ENSURE THE SECURITY OF THESE ALIASES:
1) RUN ALIAS REPOINTER IN 'NETWORK MODE', BY HOLDING DOWN THE OPTION KEY WHEN THE APPLICATION IS LAUNCHED (EITHER BY DOUBLE-CLICKING OR WHEN SOMETHING IS DROPPED ONTO IT'S ICON).
2) CAUSE ALIAS REPOINTER TO SKIP OVER THE ALIAS, LEAVING IT UNTOUCHED AND UNHARMED, BY PUTTING A BULLET ('•') AT THE END OF THE ALIAS NAME (more on that in the section called 'Version 1.1 Enhancements).
3) CAUSE ALIAS REPOINTER TO SKIP OVER THE ENTIRE FOLDER THAT THE ALIAS(ES) RESIDES IN, LEAVING IT UNTOUCHED AND UNHARMED, BY PUTTING A BULLET ('•') AT THE END OF THE FOLDER NAME (more on that in the section called 'Version 1.1 Enhancements).
ok, enough shouting--you get the picture. The worst that could happen is that Alias Repointer finds a matching file/folder locally, and repoints the alias there. If it can't find a match, it leaves the alias untouched. I figure the majority of people who use this program do not have access to remote volumes, let alone aliases to items on them. Also, this solution addresses the case where you move a folder down from a server, and want to 'repoint' all the enclosed aliases to items residing locally.
Changes for Version 1.1:
- I added the 'Network Mode' option (see long-winded explanation in above section called "Network Aliases").
- I added support for the idea of 'Disabled' aliases and 'Disabled' folders. To cause Alias Repointer to skip over an alias or folder, leaving it untouched, simply add a bullet ('•', obtained by holding down the option key and typing an '8') to the end of the name of the alias or folder. Works better than lamb's blood. You could use this technique to improve Alias Repointer's scanning performance (if you knew that a folder containing many items has no aliases in it, marking it in this way would obviate the need for Alias Repointer to search it, saving time). By looking for the bullet at of the name, Alias Repointer allows you to keep the alphabetical order of your folders intact.
- I fixed a bug that could cause a crash if Alias Repointer tries to repoint a Network Alias.
- Alias Repointer now continues searching for and repointing aliases after it encounters an alias it can't repoint. This means that Alias Repointer silently 'skips' aliases it can't repoint, and there's no way to tell which aliases were repointed and which weren't (except that the skipped ones in all likelihood don't 'work'). Version 1.0 simply quit at the first sign of trouble.
- I did some code housekeeping, and compiled it using Metrowerks CW5 release, which should generate slightly tighter and safer code (this program is so small and simple, I doubt you will see any outside affects of this).
- Because I developed this application at home in my spare time, I had no access to servers or networks--yet, I did _some_ testing of those network-related features (making sure Alias Repointer leaves certain Network Aliases untouched). I have not, however, tested this application in a variety of network settings, or with a variety of machines running a variety of operating systems. I simply don't have the resources to properly test Alias Repointer in these diverse settings. This puts the burden of testing on you, the unsuspecting public. Because of this unfortunate situation, I have lowered the Shareware fee to $10. For those of you who paid the full $20 fee, a refund has probably already beat this new version to you.
I want to thank all those who have responded with criticism--feedback is far more valuable to me than the shareware fee (even if it was just to say that the program sucks, and I should "choose another profession").
In writing this app, I had help from code written by Chris Larson and Keith Rollin--thanks, both of you (I got this source code from a cool CD full of source code examples called 'Apprentice' by Celestin).
Future enhancements could include an option to search other volumes for the target in question, a log file holding information on what it did, the option to take entire volumes as input (easy), an option to copy all the files from a source folder or volume to another place, automatically updating aliases as it goes (this would be the most accurate way to 'update' the aliases 'cuz you already know exactly what the target is for each alias copied), have it optionally write 'Relative' aliases, etc. As always, the priority and speed at which these new features get added depends on support from you, the shareware user. Constructive criticism is as welcome as the fee, so feel free to contact me via any of the ways given below.
My Shareware fee for this app is $10. Feel free to send checks, money orders, greenbacks, DAT tapes (new or used), or the numbers of any cool, single women in the Bay Area to: